/*
 *  SableJBDD, a Java Binary Decision Diagram package.
 *  Copyright (C) 2003  Feng Qian
 *
 *  This library is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU Lesser General Public
 *  License as published by the Free Software Foundation; either
 *  version 2.1 of the License, or (at your option) any later version.
 *
 *  This library is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 *  Lesser General Public License for more details.
 *
 *  You should have received a copy of the GNU Lesser General Public
 *  License along with this library; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
//$Id: RegularBddCache.java,v 1.2 2004/03/15 02:07:10 fqian Exp $

package SableJBDD.bdd.internal;

import SableJBDD.cache.TripleIntKeyCache;
import SableJBDD.bdd.JBddNode;

/**
 * A regular triple key cache takes three objects as key.
 *
 * @author Feng Qian
 */
public class RegularBddCache extends AbstractBddCache{

  /**
   * Defines a triple key cache using regular references.
   * @param impl the underlying cache implementation
   */
  public RegularBddCache (TripleIntKeyCache impl) {
    super.cacheImpl = impl;
  }

  // Implements the abstract method of TripleKeyCache.
  // Returns the regular reference.
  protected Object makeCacheValue(JBddNode node) {
    return node;
  }

  // Implements the abstract method of TripleKeyCache.
  // Returns the regular reference.
  protected JBddNode getNodeOutOfCacheValue(Object cvalue) {
    return (JBddNode)cvalue;
  }
}
